UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TwWshpp+1OUqko/7Sfh4+TsvYsVj6ht+6NO8cfCjVJM='
WHERE
key_id = 'b6b94e8625af75712a7ca6ca9ccab2834c86137fbb33336cf1b9ff5a136855b5'
AND (
token = 'TwWshpp+1OUqko/7Sfh4+TsvYsVj6ht+6NO8cfCjVJM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)