UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xQTRXETP7cyDJdNhn2VNoiH/Z4+qoAEIqiYRLetMEd8=' 
WHERE 
  key_id = '8d3b8ea51a2836770ef2ea2b8811f89ca4f22ea69e3c0d5c85773a566dbf3fd7' 
  AND (
    token = 'xQTRXETP7cyDJdNhn2VNoiH/Z4+qoAEIqiYRLetMEd8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030