UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm0II8NRinsd6tbETsI13x/p/LGhasSSCqDOfkeDpd34=' 
WHERE 
  key_id = '0f84db49440d32510c2c6769376436a3cfa8ebe872fa0628213ea6be7ec9eb14' 
  AND (
    token = 'm0II8NRinsd6tbETsI13x/p/LGhasSSCqDOfkeDpd34=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021