UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bxuoUhOr1RhFef8OsWJjqdMvtVahkVhUiGAfChTvmz0='
WHERE
key_id = '7c1a8f82861e580f854147d7c9fe85e8933493e4ffd7722579f72d734ee2cf6e'
AND (
token = 'bxuoUhOr1RhFef8OsWJjqdMvtVahkVhUiGAfChTvmz0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)