UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EeG0BIfFGGnQqHUFqQc6F5A252q+kFYrN/uC+LYkdXc='
WHERE
key_id = 'e4636db978b8cbcd266b91ac4d2699edfad9e2f96bf68c07cd4aa2723c7188d1'
AND (
token = 'EeG0BIfFGGnQqHUFqQc6F5A252q+kFYrN/uC+LYkdXc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)