UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7zCJdSUSSfeuSqllVk8trZpAk6ja26inNVwizcGRFF4='
WHERE
key_id = '5899db258a510cc2cf3868899d7216680aacc7f3ee745768d55ab897bbc1da28'
AND (
token = '7zCJdSUSSfeuSqllVk8trZpAk6ja26inNVwizcGRFF4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)