UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+YaOB0tHw1Z8K8CtGZkCtpMF6BDIisswhXliRWOlx2E='
WHERE
key_id = '30730eee769628ad6e95060f48b5146ef9bf59c1d46a16666f8b78ecb718d5cb'
AND (
token = '+YaOB0tHw1Z8K8CtGZkCtpMF6BDIisswhXliRWOlx2E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)