UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QzFj2TYqqj3ZXopApEiGV/USVjAP1LLeHLurNR3pT4k='
WHERE
key_id = '504ca86670315989f445a54f326e1b7312a3e563f875e56e23bb333349960460'
AND (
token = 'QzFj2TYqqj3ZXopApEiGV/USVjAP1LLeHLurNR3pT4k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)