UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ge23gS3t9bCGeNDr3bz712kLypIykyOX2/9HUxPjWdQ='
WHERE
key_id = 'e7a1bafb75f02022b25a6abb0d0837f038b8a1d8b5e6cc2b3aa9dafa9af3f08a'
AND (
token = 'Ge23gS3t9bCGeNDr3bz712kLypIykyOX2/9HUxPjWdQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)