UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5v/Z/EGveI9JfuTV2ZtmdfPXELYz5W1VdriuQAz3/dY='
WHERE
key_id = '99dda54b80b1d1bf1a4344dcc22f26cd7ae028cdd789e8bf29541ce9e0a06a93'
AND (
token = '5v/Z/EGveI9JfuTV2ZtmdfPXELYz5W1VdriuQAz3/dY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)