UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '10612aMEWS4p5NYi8JIlbq5q2v/lNslqVbXC1QY6X/0='
WHERE
key_id = 'e58ba74a7ddf11148f8f7d7e83dd84a3bac7563c6e61220899ab8c72067b9b6d'
AND (
token = '10612aMEWS4p5NYi8JIlbq5q2v/lNslqVbXC1QY6X/0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)