UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2K81n5jPJGrNRcP31QjKsa/gLXZMW1PQVpy/+ZFLmc8=' 
WHERE 
  key_id = 'cd7fd38fb2175a971ce538b2897c64a916c73621461ca1ca7b96a0e1e4a3ce92' 
  AND (
    token = '2K81n5jPJGrNRcP31QjKsa/gLXZMW1PQVpy/+ZFLmc8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045