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

Query time 0.00034