UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lcx9thg6XhD6hCup6eZPpR2dhpj+OWdG6H1Jbv70OXM='
WHERE
key_id = 'a19c4a91a2d67a2f4453f33be4841818d2c964a813efec7992b4609f8ae30b5c'
AND (
token = 'Lcx9thg6XhD6hCup6eZPpR2dhpj+OWdG6H1Jbv70OXM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)