UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tXKMHOkBV8M1A5bj9O62I3Wrju5NuwPabrxb//fd2A8='
WHERE
key_id = '6e534d16dd66658d09aaabd75b14e76a43580fc5eb6fb2177d0fd1253ac4250c'
AND (
token = 'tXKMHOkBV8M1A5bj9O62I3Wrju5NuwPabrxb//fd2A8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)