UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ItzE7nE9o32vWVqR3+nPoT9euJd9SJSMtdFUehB162c='
WHERE
key_id = 'c95dff7f71c6aa59b044517c4317cf4896c5c7354ea66f255ff89e6e3e9a9579'
AND (
token = 'ItzE7nE9o32vWVqR3+nPoT9euJd9SJSMtdFUehB162c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)