UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sKXXVzx2xurNONzgqohUWLNJjBDg+klgKt5oVybhQKk='
WHERE
key_id = '58d133b7d87d2e9b6455b9041d5a47693f87994e3f164fbc2ba3efe5b8278953'
AND (
token = 'sKXXVzx2xurNONzgqohUWLNJjBDg+klgKt5oVybhQKk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)