UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dKu2t2cBJVZKpoCw+VfNVE779A2gn7lDrMx0JxIqajQ='
WHERE
key_id = '18c0ec7823d31d22f57b3ba4baf3fe83e422f5b6e9af6e007b29e7e88c0608a6'
AND (
token = 'dKu2t2cBJVZKpoCw+VfNVE779A2gn7lDrMx0JxIqajQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)