UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+0KIY8yV1Z9wP7QmJn/0XPsIHlakVjOZfmB+BxnVJu8='
WHERE
key_id = '4ac225cb02f5b50bcc94bcb6f83a41de324929b82f72f8847c4ade2b4ec4dce1'
AND (
token = '+0KIY8yV1Z9wP7QmJn/0XPsIHlakVjOZfmB+BxnVJu8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)