UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Eq5c86AvfqNtytE/Pf7BJJdppNwQEsUxHVZXVmi0tsw='
WHERE
key_id = 'bdfdae64432afe1068156de7682f922bfb6e99e58fe70a1699201448ae2b1ce9'
AND (
token = 'Eq5c86AvfqNtytE/Pf7BJJdppNwQEsUxHVZXVmi0tsw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)