UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rZOQTHDXzf5AtWm5k/CH2CoUeSc+4fSSs/fHfyza2Fo='
WHERE
key_id = '65b38cfdca1ec1f9e00b2da44ecf11cabd1ec36d8ce4b485c821ee98f865a88a'
AND (
token = 'rZOQTHDXzf5AtWm5k/CH2CoUeSc+4fSSs/fHfyza2Fo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)