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

Query time 0.00034