UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9E33/jbnS4mPzkXb5d1TZXd/C7Vp4j2/dgk6wawwKPE='
WHERE
key_id = '501f9bffae3c5a772fb5732cd17faacc2c3db4b366485ed75d58bc0908b17e4c'
AND (
token = '9E33/jbnS4mPzkXb5d1TZXd/C7Vp4j2/dgk6wawwKPE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)