UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7V45Lw2jdw2kL7JYC7sFYRTjMUCWmrfDRSgOiVDhacI='
WHERE
key_id = '810038e849a40662543afe6dd211cbde26ba7a93858c43adf2ddf5be10fc9c54'
AND (
token = '7V45Lw2jdw2kL7JYC7sFYRTjMUCWmrfDRSgOiVDhacI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)