UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EQNOKtYv87wpRO9h0rIZKgDqY5qNTD8vZ3ZWunFeq7U='
WHERE
key_id = 'edad43e4c76d2aa5b96e1bf12b55bea5a8a971405f6719c4030f3af66f0e88b6'
AND (
token = 'EQNOKtYv87wpRO9h0rIZKgDqY5qNTD8vZ3ZWunFeq7U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)