UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xB4rx1uju2dVOFrw2A301eZ06hGpjRTJiinAPuFF99c='
WHERE
key_id = 'b98bb5ac31f600e81a772d00f8d93552f219fb6ac850bb2fc1c09facaf0f6bf3'
AND (
token = 'xB4rx1uju2dVOFrw2A301eZ06hGpjRTJiinAPuFF99c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)