UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sUnoaemmljVm01e7f3BqgtPUh01/vLN64BVS5psFfy0=' 
WHERE 
  key_id = 'baa36092d762a1f1c39c44a067fc0713e815c0a06e6a079fbf19a694cc6b924a' 
  AND (
    token = 'sUnoaemmljVm01e7f3BqgtPUh01/vLN64BVS5psFfy0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061