UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qV+lCTAFqd9y1l4qMbBxUzpM9lK5F3ULRBZNSGuAWl0='
WHERE
key_id = 'd3dd7c12cd88797ac35b1b4dd630531c4a0ca16ddbfe8a2a85ee2817be7e1de0'
AND (
token = 'qV+lCTAFqd9y1l4qMbBxUzpM9lK5F3ULRBZNSGuAWl0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)