UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N3npIPVk2OL16vlAVNvz4t0mhs/MKRGASwjIqwt7fbc='
WHERE
key_id = '010d906bc5fa683656ef1f6eb237f8c54bf1fcb814ca0c3aeea4296c4aef3dda'
AND (
token = 'N3npIPVk2OL16vlAVNvz4t0mhs/MKRGASwjIqwt7fbc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)