UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jrCqR3uB7xyefTi2LFsaLkhDIBctGZwL7PcL41mey1w='
WHERE
key_id = '60d9bdaa8c783877f76b9939196d74bcc051ffa6b51470d0dd30956324459621'
AND (
token = 'jrCqR3uB7xyefTi2LFsaLkhDIBctGZwL7PcL41mey1w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)