UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZZP+qtfYyqoRCFC5YG3orvdQkVx2h5dv9oSAU/vxO00='
WHERE
key_id = '4fb3e5c2ce88e9204b1c336e9ee65793b1878160e86fbe766ddd953ad4c4a79c'
AND (
token = 'ZZP+qtfYyqoRCFC5YG3orvdQkVx2h5dv9oSAU/vxO00='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)