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