UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c2hhxov9hs2N6Hj791H7Hj6sCKaUbKBMbZSVzdI0pDo=' 
WHERE 
  key_id = '5e2f205f0b89c534aafb287cd31fe1be16ff8804a4fb88afd718e0c1dfebfa95' 
  AND (
    token = 'c2hhxov9hs2N6Hj791H7Hj6sCKaUbKBMbZSVzdI0pDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043