UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ywgBxJyzUVVSRUIbxZbxT7XRwlpNJWimJuLLYJc4/3M='
WHERE
key_id = 'dfa3caa4c06eb75df45e0dfd9b98a1a7e1ebf71e2fd0b74962118d96393e3ba0'
AND (
token = 'ywgBxJyzUVVSRUIbxZbxT7XRwlpNJWimJuLLYJc4/3M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)