UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qwViVCTxRuOq3EKkLDpiQ8OmCXnHYzAVTzkvDdwjhYw='
WHERE
key_id = '0a77ad0b104561645eadf70967fe0b0c6da9130e890649f720c27dde9eb4d5b1'
AND (
token = 'qwViVCTxRuOq3EKkLDpiQ8OmCXnHYzAVTzkvDdwjhYw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)